package com.ang.propagation.t4;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

@Component
public class TService1 {

    @Autowired
    private JdbcTemplate jdbcTemplate;

    @Autowired
    private TService2 tService2;

    @Transactional
    public void trans(){
        tService2.trans2();

        jdbcTemplate.update("insert into t_user ('name','age') values(?,?)",new Object[]{"t1",3});
    }
}
